home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 4.4 KB | 176 lines | [TEXT/MPS ] |
- ;
- ; File: Keyboard.a
- ;
- ; Contains: interfaces for keyboard componets
- ;
- ; Version: Technology:
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__KEYBOARD__') = 'UNDEFINED' THEN
- __KEYBOARD__ SET 1
-
- IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
- include 'ConditionalMacros.a'
- ENDIF
- IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
- include 'Events.a'
- ENDIF
- IF &TYPE('__IOITERATOR__') = 'UNDEFINED' THEN
- include 'IOIterator.a'
- ENDIF
- IF &TYPE('__TIMING__') = 'UNDEFINED' THEN
- include 'Timing.a'
- ENDIF
- IF FOR_SYSTEM8_PREEMPTIVE THEN
- ; Virtual ID for a keyboard
- ; typedef UInt32 KeyboardID
-
- ; System 8.x version of of a Keymap
- KeyboardMap RECORD 0
- elements ds.b 32
- sizeof EQU * ; size: $20 (32)
- ENDR
-
-
- ; System 8.x version of a virtual key
- ; typedef UInt8 VirtualKeyCode
-
- ; System 8.x definition of keyboard modifiers
- ; typedef UInt16 KeyboardModifiers
-
- ; System 8.x definition of keyboard direction
-
- kKeyDirectionKeyDown EQU $0001
- kKeyDirectionKeyUp EQU $0002
- kKeyDirectionAutoKeyDown EQU $0003
- ; typedef short KeyDirection
-
- ; typedef UInt32 KeyboardDeviceMode
-
- ; Keyboard Event returned from I/O subsystem
- LowLevelKeyEvent RECORD 0
- theBoard ds.l 1 ; offset: $0 (0)
- theKey ds.b 1 ; offset: $4 (4)
- filler1 ds.b 1 ; offset: $5 (5)
- direction ds.w 1 ; offset: $6 (6)
- modifiers ds.w 1 ; offset: $8 (8)
- theEventTime ds AbsoluteTime ; offset: $A (10)
- sizeof EQU * ; size: $12 (18)
- ENDR
-
- kKeyboardHardwareTypeUnknown EQU 0
- kKeyboardHardwareTypeADB EQU 1
- kKeyboardHardwareTypeSerial EQU 2
- ; typedef UInt32 KeyboardHardwareType
-
- KeyboardIOIteratorData RECORD 0
- IOCommon ds IOCommonInfo ; offset: $0 (0)
- theType ds.l 1 ; offset: $14 (20)
- keycount ds.l 1 ; offset: $18 (24)
- kcapResID ds.l 1 ; offset: $1C (28)
- hasNumericKeypad ds.b 1 ; offset: $20 (32)
- hasLEDFeedback ds.b 1 ; offset: $21 (33)
- sizeof EQU * ; size: $22 (34)
- ENDR
- KeyboardDeviceRecord RECORD 0
- f ds KeyboardIOIteratorData
- sizeof EQU * ; size: $22 (34)
- ENDR
-
-
-
- kKeyboardLEDOff EQU 0
- kKeyboardLEDOn EQU 1
- ; typedef Boolean KeyboardLEDState
-
-
- kKeyboardLEDNumLock EQU 0
- kKeyboardLEDCapsLock EQU 1
- kKeyboardLEDScrollLock EQU 2
- ; typedef short KeyboardLEDSelector
-
- ;
- ; extern OSStatus GetKeyMap(KeyboardID theID, KeyboardMap theMap)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetKeyMap
- ENDIF
-
- ;
- ; extern OSStatus KeyboardIsKeyDown(VirtualKeyCode theKey, KeyDirection *keyState, KeyboardModifiers *modifierState)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION KeyboardIsKeyDown
- ENDIF
-
- ; Warning: This routine is intended only for clients who need to bypass the events system altogether.
- ;
- ; extern OSStatus GetNextLowLevelKeyEvent(LowLevelKeyEvent *theKey)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetNextLowLevelKeyEvent
- ENDIF
-
- ;
- ; extern OSStatus GetLastKeypressTime(AbsoluteTime *theTime)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetLastKeypressTime
- ENDIF
-
- ;
- ; extern OSStatus GetKeyboardLEDStatus(KeyboardID theID, short theLight, Boolean *value)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetKeyboardLEDStatus
- ENDIF
-
- ;
- ; extern OSStatus SetKeyboardLEDStatus(KeyboardID theID, short theLight, Boolean value)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetKeyboardLEDStatus
- ENDIF
-
- ;
- ; extern OSStatus GetKeyboardDeviceMode(KeyboardID theID, KeyboardDeviceMode *theMode)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetKeyboardDeviceMode
- ENDIF
-
- ;
- ; extern OSStatus SetKeyboardDeviceMode(KeyboardID theID, KeyboardDeviceMode theMode)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetKeyboardDeviceMode
- ENDIF
-
- ; Device Iteration
- ;
- ; extern OSStatus GetKeyboardDeviceRecord(KeyboardID theID, KeyboardDeviceRecord *theDeviceRecord)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetKeyboardDeviceRecord
- ENDIF
-
- ;
- ; extern OSStatus KeyboardGetDeviceData(ItemCount requestItemCount, ItemCount *totalItemCount, KeyboardIOIteratorData *iteratorBuffer)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION KeyboardGetDeviceData
- ENDIF
-
- ENDIF
- ENDIF ; __KEYBOARD__
-
-